package com.csdj.music.controller;

import com.csdj.music.service.TRoleService;
import com.csdj.music.vo.RespBean;
import com.csdj.music.vo.TRole;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName: Role
 * @Author: ZouLi
 * @Description: 权限控制器
 * @Date: 2023/3/13 16:11
 **/
@RestController
@Api(tags = "权限控制器")
@RequestMapping("/role")
public class RoleController {

    /**
     * RoleService
     **/
    @Autowired
    private TRoleService roleService;

    @ApiOperation("根据管理员id获取权限")
    @GetMapping("/getRoleByAdminId")
    public RespBean getRoleByAdminId(Integer id){
        List<TRole> roles = roleService.getRolesByAdminId(id);
        return RespBean.success("获取成功！",roles);
    }
}
